{% extends 'base.html' %}

{% block title %}首页{% endblock title %}

{% block left %}
    <div id="main">
            {#  分享功能  #}
    <div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone"></a><a href="#" class="bds_tsina" data-cmd="tsina"></a><a href="#" class="bds_tqq" data-cmd="tqq"></a><a href="#" class="bds_renren" data-cmd="renren"></a><a href="#" class="bds_weixin" data-cmd="weixin"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>

            {#  显示帖子信息  #}
        {% for post in postList %}
            <article class="article article-type-post">
                <div class="article-meta">
                    <a class="article-date">
                        <time>{{ post.create|date:"Y-m-d H:i:s" }}</time>
                    </a>
                    <div class="article-category">
                        <a class="article-category-link" href="#" target="_blank">{{ post.pcategory.cname }}</a>
                    </div>
                </div>
            <div class="article-inner">
                <header class="article-header">
                    <h1 itemprop="name">
                        <a class="article-title" href="#" target="_blank">{{ post.ptitle }}</a>
                    </h1>
                </header>
                <div class="article-entry" itemprop="articleBody">
                    <h2>前言</h2>
                    <hr>
                    <p>{{ post.pdesc }}</p>
                    <p class="article-more-link">
                        <a href="/post/page/detail/{{ post.pid }}" target="_blank">阅读全文</a>
                    </p>
                </div>
                <footer class="article-footer">
                    <a data-url="存放文章的url" class="article-share-link">分享</a>
                    <ul class="article-tag-list">
                        {% for tag in post.ptag.all %}
                        <li class="article-tag-list-item">
                            <a class="article-tag-list-link" href="#">{{ tag.tname }}</a>
                        </li>
                        {% endfor %}
                    </ul>
                </footer>
            </div>
            </article>
        {% endfor %}

            {#  显示页数  #}
        <nav id="page-nav">
        {% if postList.has_previous %}
            <a class="extend prev" rel="next" href="/post/page/{{ postList.previous_page_number }}"><< Previous</a>
        {% endif %}
        {% for page in pageList %}
            {% if currentPage == page %}
                <span class="page-number current">{{ page }}</span>
            {% else %}
                <a class="page-number" href="/post/page/{{ page }}">{{ page }}</a>
            {% endif %}
        {% endfor %}
        {% if postList.has_next %}
            <a class="extend next" rel="next" href="/post/page/{{ postList.next_page_number }}">Next >></a>
        {% endif %}
        </nav>
    </div>


{% endblock left %}